package com.asset.inventory.network

import io.reactivex.FlowableTransformer
import io.reactivex.ObservableTransformer
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

/**
 *    @author : sibb
 *    date   : 21-4-7
 *    desc   :
 */
object RxScheduler {

    /**
     * 统一线程处理
     *
     * @param <T> 指定的泛型类型
     * @return FlowableTransformer
     */
    fun <T> io_main(): ObservableTransformer<T, T> {
        return  ObservableTransformer<T, T>() {
            it.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
        }
    }

}
